#pragma once
#include "Globals.h"
#include "Node.h"
#include "Character.h"
#include "Pickup Item.h"

//This class creates and manages the world.
// At startup it generates a randomly defined set of Nodes
//
//An example Node
// *--*  * = Filler Block
// |  |  | or -- = Wall Block
// *--*
//
//To create the maze each time, it uses a basic recursive searching algortihm
//The end location is defined, then it branches out until it no longer can can create paths
//At each new step in the recursive searching, it checks if it wants to add an item, such as a Coin or enemy
//Because of this randomness, the mazes can contain a large amount of one, the other, or both and vice versa
//When it rerandomizes, it cleans up the old data and resets it to make sure that nothing glitches

class Maze
{
private:
	Maze();
	bool**			m_ppItemPos;
	Pickup*			m_EndItem;
	Node**			m_clppMyGrid;
	D3DXVECTOR3		m_vCenter;
	Vector<Enemy*>	m_AllEnemies;
	Vector<Pickup*>	m_AllItems;
public:
	~Maze();
	void Reset();
	void Deconstruct();
	static Maze* Engine()
	{
		static Maze TheWorld;
		return &TheWorld;
	}
	bool Init(){return true;}
	void CreateMap(int x,int y);
	void CheckDirections(int x,int y);
	void SetListInfo(DrawList* drawlist);
	void Create();
	void Delete();
};